//管理员删除系统消息
export async function admin_DELETE_msg(type, id, proxy) {
    try {
        const response = await proxy.$http.post(`/del_message/`, { type: type, id: id });
        if (response.status !== 200)
            throw new Error(`HTTP error! Status: ${response.status}`);

        return response;
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}

//管理员获取自己的系统消息记录
export async function admin_IPC_recv(proxy) {
    try {
        const response = await proxy.$http.post(`/receive/`, { });
        if (response.status !== 200)
            throw new Error(`HTTP error! Status: ${response.status}`);

        return response;
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}

//管理员发送系统消息
export async function admin_IPC_send(message, date, proxy) {
    try {
        const response = await proxy.$http.post(`/send/`, { mess: message, date: date });
        if (response.status !== 200)
            throw new Error(`HTTP error! Status: ${response.status}`);

        return response;
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}

